package com.blb.service.impl;

import com.blb.entity.Notes;
import com.blb.mapper.NotesMapper;
import com.blb.service.INotesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ZhengSanNan
 * @since 2019-12-20
 */
@Service
public class NotesServiceImpl extends ServiceImpl<NotesMapper, Notes> implements INotesService {

    @Resource
    private NotesMapper notesMapper;

    @Override
    public List<Notes> newnote(String userid) {
        return notesMapper.newnote(userid);
    }

    @Override
    public List<Notes> getNewNote() {
        return notesMapper.getNewNote();
    }

    @Override
    public List<Notes> getNoteByLabelId(String labelId) {
        return notesMapper.getNoteByLabelId(labelId);
    }

    @Override
    public List<Notes> getNoteListByNotesName(String notesName, String favorite,String userId) {
        favorite = favorite == ""?null:favorite;
        return notesMapper.getNoteListByNotesName(notesName,favorite,userId);
    }

    @Override
    public int getCount(String notesName, String favorite,String userId) {
        favorite = favorite == ""?null:favorite;
        return notesMapper.getCount(notesName,notesName,userId);
    }

    @Override
    public List<Notes> getOneNote(String userid, String id) {
        return null;
    }

    @Override
    public void updateStars(String id, String favorite) {

    }

    @Override
    public void updateNotes(String id, String notesName, String content, Date date) {

    }

    @Override
    public List<Notes> sortNotes(String type, String token) {
        return null;
    }

    @Override
    public List<Notes> getAllNotes() {
        return notesMapper.getAllNotes();
    }

    @Override
    public List<Notes> getAllNotesByClassId(String classificationId) {
        return notesMapper.getAllNotesByClassId(classificationId);
    }


}
